package com.youfang.sixthmedia.message;

import java.util.LinkedList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.youfang.sixthmedia.message.model.City;
import com.youfang.sixthmedia.net.Response;

/**
 * 获取新楼房列表请求
 * 
 * @author Administrator
 * 
 */
public class GetCityResponse extends Response {

	private List<City> citys = new LinkedList<City>();

	@Override
	protected void decodeBody(JSONObject bodyJSON) throws Exception {

		JSONArray arr = bodyJSON.getJSONArray("data");
		for (int i = 0; i < arr.length(); i++) {
			JSONObject o = arr.getJSONObject(i);
			City bean = new City();
			bean.cityid = o.getInt("cityid");

			bean.name = o.getString("name");
			bean.ishot = o.getString("ishot");

			this.citys.add(bean);

		}

	}

	public List<City> getCitys() {
		return citys;
	}

	public void setCitys(List<City> citys) {
		this.citys = citys;
	}

}
